package com.wantong.jianpu.activitys;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.lxj.xpopup.XPopup;
import com.wantong.jianpu.BR;
import com.wantong.jianpu.R;
import com.wantong.jianpu.base.BaseXActivity;
import com.wantong.jianpu.databinding.ActivityFaultHandleBinding;
import com.wantong.jianpu.viewmodels.FaultHandleViewModel;

/**
 * 故障处理
 */
public class FaultHandleActivity extends BaseXActivity<ActivityFaultHandleBinding, FaultHandleViewModel> {

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_fault_handle;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        super.initData();
        setToolbar(binding.baseToolBar);
        viewModel.id=getIntent().getExtras().getString("id");

        viewModel.stateDialogEvent.observe(this, strings -> {
            new XPopup.Builder(FaultHandleActivity.this)
                    .asBottomList("请选择故障处理", strings,
                            (position, text) -> {
                                viewModel.setState(text);
                            }).show();
        });
    }
}